package pub.developers.forum.infrastructure.dal.dao;

import org.apache.ibatis.annotations.Param;
import pub.developers.forum.api.response.data.LastMonthData;
import pub.developers.forum.infrastructure.dal.dataobject.UserFollowDO;

import java.util.List;


public interface UserFollowDAO {

    UserFollowDO get(@Param("userId") Long userId, @Param("commentId") Long commentId,@Param("type") String followed_type);

    Long getLike(Long userId,Long postId);

    void insert(UserFollowDO userFollowDO);

    List<UserFollowDO> query(UserFollowDO userFollowDO);

    Long queryId(@Param("followerId") Long followerId,@Param("followedId") Long followedId,@Param("type") String type);

    void delete(@Param("id") Long id);

    List<Long> getAllFollowerIds(@Param("follower") Long follower, @Param("type") String type);

    //获取当前用户的粉丝id
    Long[] querySelfFans(Long id);

    Long[] queryFollower(Long id);

    //拿到给我对应帖子点赞的人的id
    Long[] selectFollowPostUserId(Long postsId);

    //拿到我点过赞的帖子的id
    List<Long> selectMyLovePosts(Long id);

    //判断当前用户是否给帖子点过赞
    Long selectIsLike(@Param("followed") Long followed , @Param("follower") Long follower);

    //查询昨日新增互动数(用户互相关注数据 , 点赞数据)
    Long selectNewAddFollow(@Param("yesterday") String yesterday , @Param("today") String today);

    //统计近一个月每日的新增互动数
    List<LastMonthData> selectMonthData(@Param("lastMonthDay") String monthDay , @Param("today") String today);

    //我关注的别人
    List<Long> myLovePerson(Long id);

    Long followedMy(@Param("id") Long id , @Param("followID") Long followerID);
}
